/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PacientPanel.java
 *
 * Created on 09.05.2009, 14:11:28
 */
package ru.vsu.cs.piit.vokod.view.panels;

import datechooser.events.CommitEvent;
import datechooser.events.CommitListener;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.InputVerifier;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;
import ru.vsu.cs.piit.vokod.TableModels.CBModel;
import ru.vsu.cs.piit.vokod.controller.Controller;
import ru.vsu.cs.piit.vokod.controller.Maps;
import ru.vsu.cs.piit.vokod.model.*;

/**
 *
 * @author Галчонок
 */
public class DailyMovePanel extends javax.swing.JPanel {

    DailyMove dailyMove = new DailyMove(true);
    InputVerifier verifier = new InputVerifier() {

        @Override
        public boolean verify(JComponent comp) {
            boolean returnValue;
            JTextField textField = (JTextField) comp;
            if (textField.getText().compareTo("") != 0) {
                try {
                    Integer.parseInt(textField.getText());
                    textField.setBorder(new LineBorder(Color.BLACK, 1));
                    returnValue = true;
                } catch (NumberFormatException e) {
                    textField.setBorder(new LineBorder(Color.RED, 1));
                    returnValue = false;
                }
            } else {
                returnValue = true;
            }
            return returnValue;
        }
    };

    public DailyMovePanel() {
        super();
        initComponents();

        this.setSize(this.getPreferredSize());
        AddActions();
        setValues();
    }

    public DailyMovePanel(DailyMove dailyMove) {
        this();
        this.dailyMove = dailyMove;
        setValues();
    }

    public void setEveningCount() {
        dailyMove.setEveningCount(dailyMove.getMorningCount() +
                dailyMove.getEnterAll() +
                dailyMove.getMoveFromOthers() +
                dailyMove.getMoveFromRao() -
                dailyMove.getMoveAtOthers() -
                dailyMove.getMoveAtRao() -
                dailyMove.getLeaveHome() -
                dailyMove.getDied());
        tbEveningCount.setText(dailyMove.getEveningCount().toString());
    }

    private void setValues() {
        Integer tmp;
        chDateOfMove.getCurrent().setTime(dailyMove.getDateOfMove());
        cbWard.getModel().setSelectedItem(dailyMove.getWard());
        if (!(tmp = dailyMove.getDied()).equals(0)) {
            tbDied.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getEnter018()).equals(0)) {
            tbEnter018.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getEnterAll()).equals(0)) {
            tbEnterAll.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getEnterMore60()).equals(0)) {
            tbEnterMore60.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getEnterOutside()).equals(0)) {
            tbEnterOutside.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getEveningCountOutside()).equals(0)) {
            tbEveningCountOutside.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getLeaveAtOthers()).equals(0)) {
            tbLeaveAtOthers.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getLeaveHome()).equals(0)) {
            tbLeaveHome.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getMorningCount()).equals(0)) {
            tbMorningCount.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getMoveAtOthers()).equals(0)) {
            tbMoveAtOthers.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getMoveAtRao()).equals(0)) {
            tbMoveAtRao.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getMoveFromOthers()).equals(0)) {
            tbMoveFromOthers.setText(tmp.toString());
        }
        if (!(tmp = dailyMove.getMoveFromRao()).equals(0)) {
            tbMoveFromRao.setText(tmp.toString());
        }
        setEveningCount();
    }

    private void AddActions() {

        tbDied.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbDied.getText() != null) {
                    dailyMove.setDied(Integer.parseInt(tbDied.getText()));
                    setEveningCount();
                }
            }
        });

        tbEnter018.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEnter018.getText() != null) {
                    dailyMove.setEnter018(Integer.parseInt(tbEnter018.getText()));
                }
            }
        });

        tbEnterAll.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEnterAll.getText() != null) {
                    dailyMove.setEnterAll(Integer.parseInt(tbEnterAll.getText()));
                    setEveningCount();
                }
            }
        });

        tbEnterMore60.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEnterMore60.getText() != null) {
                    dailyMove.setEnterMore60(Integer.parseInt(tbEnterMore60.getText()));
                }
            }
        });

        tbEnterOutside.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEnterOutside.getText() != null) {
                    dailyMove.setEnterMore60(Integer.parseInt(tbEnterOutside.getText()));
                }
            }
        });

        tbEnterOutside.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEnterOutside.getText() != null) {
                    dailyMove.setEnterOutside(Integer.parseInt(tbEnterOutside.getText()));
                }
            }
        });

        tbEveningCountOutside.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbEveningCountOutside.getText() != null) {
                    dailyMove.setEveningCountOutside(Integer.parseInt(tbEveningCountOutside.getText()));
                }
            }
        });

        tbLeaveAtOthers.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbLeaveAtOthers.getText() != null) {
                    dailyMove.setLeaveAtOthers(Integer.parseInt(tbLeaveAtOthers.getText()));
                }
            }
        });

        tbLeaveHome.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbLeaveHome.getText() != null) {
                    dailyMove.setLeaveHome(Integer.parseInt(tbLeaveHome.getText()));
                    setEveningCount();
                }
            }
        });

        tbMorningCount.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbMorningCount.getText() != null) {
                    dailyMove.setMorningCount(Integer.parseInt(tbMorningCount.getText()));
                    setEveningCount();
                }
            }
        });

        tbMoveAtOthers.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbMoveAtOthers.getText() != null) {
                    dailyMove.setMoveAtOthers(Integer.parseInt(tbMoveAtOthers.getText()));
                    setEveningCount();
                }
            }
        });

        tbMoveAtRao.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbMoveAtRao.getText() != null) {
                    dailyMove.setMoveAtRao(Integer.parseInt(tbMoveAtRao.getText()));
                    setEveningCount();
                }
            }
        });

        tbMoveFromOthers.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbMoveFromOthers.getText() != null) {
                    dailyMove.setMoveFromOthers(Integer.parseInt(tbMoveFromOthers.getText()));
                    setEveningCount();
                }
            }
        });

        tbMoveFromRao.addFocusListener(new FocusListener() {

            @Override
            public void focusGained(FocusEvent e) {
            }

            @Override
            public void focusLost(FocusEvent e) {
                if (tbMoveFromRao.getText() != null) {
                    dailyMove.setMoveFromRao(Integer.parseInt(tbMoveFromRao.getText()));
                    setEveningCount();
                }
            }
        });

        cbWard.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                dailyMove.setWard((Ward) cbWard.getModel().getSelectedItem());
            }
        });

        cbWard.addItemListener(new ItemListener() {

            @Override
            public void itemStateChanged(ItemEvent e) {
                dailyMove.setWard((Ward) cbWard.getModel().getSelectedItem());
            }
        });


        chDateOfMove.addCommitListener(new CommitListener() {

            @Override
            public void onCommit(CommitEvent evt) {
                dailyMove.setDateOfMove(chDateOfMove.getCurrent().getTime());
            }
        });

        jAddWardBtn.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Controller.getInstance().addWard();
            }
        });

    }

    public DailyMove getDailyMove() {
        return dailyMove;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        cbWard = new JComboBox(new CBModel(Maps.getWardList()));
        jLabel1 = new javax.swing.JLabel();
        tbMorningCount = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jAddWardBtn = new javax.swing.JButton();
        chDateOfMove = new datechooser.beans.DateChooserCombo();
        jPanel1 = new javax.swing.JPanel();
        tbEnterAll = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        tbEnterOutside = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        tbEnter018 = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        tbEnterMore60 = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        tbMoveFromOthers = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        tbMoveFromRao = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        tbMoveAtOthers = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        tbMoveAtRao = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        tbLeaveHome = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        tbLeaveAtOthers = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        tbDied = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        tbEveningCount = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        tbEveningCountOutside = new javax.swing.JTextField();

        jLabel2.setText("Дата");

        jLabel1.setText("Отделение");

        tbMorningCount.setInputVerifier(verifier);

        jLabel11.setText("<html>Состояло больных<br>на начало суток");

        jAddWardBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ru/vsu/cs/piit/vokod/resources/add.gif"))); // NOI18N

        chDateOfMove.setBehavior(datechooser.model.multiple.MultyModelBehavior.SELECT_SINGLE);
        chDateOfMove.setCurrentNavigateIndex(0);
        chDateOfMove.setNothingAllowed(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Поступило больных"));
        jPanel1.setToolTipText("");

        tbEnterAll.setInputVerifier(verifier);

        jLabel16.setText("Всего");

        jLabel17.setText("Сельских жителей");

        tbEnterOutside.setInputVerifier(verifier);

        jLabel18.setText("0-18 лет");

        tbEnter018.setInputVerifier(verifier);

        jLabel19.setText("60 лет м более");

        tbEnterMore60.setInputVerifier(verifier);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbEnterAll, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbEnter018, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbEnterOutside, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbEnterMore60, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEnterAll, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEnterOutside, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEnter018, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEnterMore60, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Переведено больных"));
        jPanel2.setToolTipText("");

        tbMoveFromOthers.setInputVerifier(verifier);

        jLabel20.setText("Из других отделений");

        jLabel21.setText("Из РАО");

        tbMoveFromRao.setInputVerifier(verifier);

        jLabel22.setText("В другие отделения");

        tbMoveAtOthers.setInputVerifier(verifier);

        jLabel23.setText("В РАО");

        tbMoveAtRao.setInputVerifier(verifier);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbMoveFromOthers, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbMoveAtOthers, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbMoveFromRao, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbMoveAtRao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbMoveFromOthers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbMoveFromRao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbMoveAtOthers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbMoveAtRao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23)))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Выписано"));
        jPanel4.setToolTipText("");

        tbLeaveHome.setInputVerifier(verifier);

        jLabel28.setText("Всего");

        jLabel29.setText("В другие стационары");

        tbLeaveAtOthers.setInputVerifier(verifier);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbLeaveHome, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbLeaveAtOthers, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbLeaveHome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbLeaveAtOthers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)))
        );

        jLabel30.setText("Умерло");

        tbDied.setInputVerifier(verifier);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Состоит больных на начало текущих суток"));
        jPanel5.setToolTipText("");

        tbEveningCount.setEditable(false);
        tbEveningCount.setInputVerifier(verifier);

        jLabel31.setText("Всего");

        jLabel32.setText("<html>В том числе<br>сельских жителей");

        tbEveningCountOutside.setInputVerifier(verifier);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbEveningCount, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                    .addComponent(tbEveningCountOutside, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEveningCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbEveningCountOutside, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tbDied, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1))
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(chDateOfMove, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(cbWard, 0, 202, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jAddWardBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(tbMorningCount, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))))
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(chDateOfMove, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(cbWard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jAddWardBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbMorningCount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbDied, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cbWard;
    private datechooser.beans.DateChooserCombo chDateOfMove;
    private javax.swing.JButton jAddWardBtn;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JTextField tbDied;
    private javax.swing.JTextField tbEnter018;
    private javax.swing.JTextField tbEnterAll;
    private javax.swing.JTextField tbEnterMore60;
    private javax.swing.JTextField tbEnterOutside;
    private javax.swing.JTextField tbEveningCount;
    private javax.swing.JTextField tbEveningCountOutside;
    private javax.swing.JTextField tbLeaveAtOthers;
    private javax.swing.JTextField tbLeaveHome;
    private javax.swing.JTextField tbMorningCount;
    private javax.swing.JTextField tbMoveAtOthers;
    private javax.swing.JTextField tbMoveAtRao;
    private javax.swing.JTextField tbMoveFromOthers;
    private javax.swing.JTextField tbMoveFromRao;
    // End of variables declaration//GEN-END:variables

}
